<div class="layui-form hisi-search">
        <form action="{:url()}" method="get" id="hisi-table-search">
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="date" class="layui-input" id="dateFilter" placeholder=" 支付时间过滤 ">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="order_no" lay-verify="required" placeholder="按订单号搜索" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="trade_no" lay-verify="required" placeholder="按交易号搜索" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <input type="text" name="uid" lay-verify="required" placeholder="按用户标识搜索" autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <select name="method" class="layui-input">
                        <option value="">支付平台</option>
                        {volist name="payment" id="vo"}
                            <option value="{$vo['code']}">{$vo['title']}</option>
                        {/volist}
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-input-inline">
                    <select name="status" class="layui-input">
                        <option value="">支付状态</option>
                        <option value="0">支付失败</option>
                        <option value="1">待支付</option>
                        <option value="2">支付成功</option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item hisi-search-btn">
                <div class="layui-input-inline">
                    <button type="submit" class="layui-btn layui-btn-normal layui-icon layui-icon-search">查询</button><button type="reset" class="layui-btn layui-btn-primary layui-icon layui-icon-delete">重置</button>
                </div>
            </div>
        </form>
    </div>
    <table id="dataTable" lay-filter="dataTable"></table>

    <script id="toolbar" type="text/html"></script>
    {include file="system@block/layui" /}
    <script type="text/javascript">
        layui.use(['jquery', 'laydate', 'table'], function() {
            var payment = {:json_encode($payment)};
            var $ = layui.jquery, laydate = layui.laydate, table = layui.table;
            table.render({
                elem: '#dataTable'
                ,url: '{:url()}' //数据接口
                ,page: true //开启分页
                ,limit: 15
                ,limits:[15, 30, 50, 100, 200]
                ,cellMinWidth: 90
                ,text: {
                    none : '暂无相关数据'
                }
                ,toolbar: '#toolbar'
                ,defaultToolbar: ['filter', 'exports']
                ,cols: [[ //表头
                    {field: 'uid', title: '用户标识', width:90}
                    ,{field: 'order_no', title: '订单号'}
                    ,{field: 'method', width: 150, title: '支付平台', templet: function(d) {
                        if (!payment[d.method]) return '---';
                        return payment[d.method].title;
                    }}
                    ,{field: 'trade_no', width: 260, title: '支付平台交易号'}
                    ,{field: 'money', width: 110, sort: true, title: '交易金额', templet: function(d) {
                        if (d.type == 2) {
                            return '<strong style="color:#f00">-'+d.money+'</strong>';
                        }
    
                        return d.money;
                    }}
                    ,{field: 'status', width: 120, title: '交易状态', sort: true, templet: function(d) {
                        if (d.status == 0) {
                            return '支付失败';
                        } else if (d.status == 1) {
                            return '待支付';
                        } else {
                            return '支付成功';
                        }
                    }}
                    ,{field: 'ctime', title: '创建时间', sort: true}
                    ,{title: '操作', width: 90, templet: function(d) {
                        return '<a href="{:url("del")}?table=pay_log&id='+d.id+'" class="j-tr-del layui-btn layui-btn-xs layui-btn-danger">删除</a>';
                    }}
                ]]
                ,done: function(){
                    if (typeof(layui.global.addTableTool) !== 'undefined') {
                        layui.global.addTableTool();
                    }
                }
            });
    
            // 筛选
            $('#searchForm').submit(function(){
                var that = $(this), arr = that.serializeArray(), whereObj = {};
                for(var i in arr) {
                    whereObj[arr[i].name] = arr[i].value;
                }
                
                table.reload('table', {
                  url: '{:url()}',
                  where: whereObj
                });
                return false;
            });
    
            laydate.render({
                elem: '#dateFilter'
                ,range: true
            });
        });
    </script>